package com.woyowodaows.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import android.widget.TextView;

import com.woyowodaows.R;
import com.woyowodaows.weight.DownloadProgressBar;


/**
 * @author haiwei
 *         更新apk提示框
 *         2017/4/11
 */

public class DownloadApkDialog {

    private Context context;
    public TextView dialog_button_cancel;
    public DownloadProgressBar pb_download;
    public Dialog dialog;

    public DownloadApkDialog(Context context) {
        this.context = context;
        initDialog();
    }

    public void initDialog() {
        dialog = new Dialog(context, R.style.dialog);
		dialog.setCancelable(false);
        dialog.setCanceledOnTouchOutside(false);
        Window window = dialog.getWindow();
        window.setContentView(R.layout.dialog_load_apk);
        dialog_button_cancel = (TextView) window.findViewById(R.id.dialog_button_cancel);
        pb_download = (DownloadProgressBar) window.findViewById(R.id.pb_download);
    }



    /**
     * 显示dialog
     */
    public void showDialog() {
        if (dialog != null)
            dialog.show();
    }

    /**
     * 关闭dialog
     */
    public void hideDialog() {
        if (dialog != null)
            dialog.dismiss();
    }



}
